javascript count elements in json object

58

javascript count elements in json object -

  var myObject = {'name':'Sherlock', 'address':'221b Bakerstreet','city': 'London'}

  var count = Object.keys(myObject).length;
  console.log(count);

Comments

Submit
0 Comments